]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
padOsd: Only allocate child labels within allocate vfunc
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 29 May 2020 14:05:57 +0000 (16:05 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Fri, 29 May 2020 18:06:48 +0000 (18:06 +0000)
Make both start/stop edition and label updates queue a relayout, and
only deal with child allocations in the allocate method.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1290

js/ui/padOsd.js

index 32b0584dda6fd3a73becd483caf43737e17d8511..3e7b7beac086cd3e2eee62a1bbfabcbfa234fecd 100644 (file)
@@ -592,15 +592,13 @@ var PadDiagram = GObject.registerClass({
             let str = getText(action, idx, dir);
             label.set_text(str);
         }
+
+        this.queue_relayout();
     }
 
     _applyLabel(label, action, idx, dir, str) {
-        if (str != null) {
+        if (str !== null)
             label.set_text(str);
-
-            let [found_, x, y, arrangement] = this._getLabelCoords(action, idx, dir);
-            this._allocateChild(label, x, y, arrangement);
-        }
         label.show();
     }
 
@@ -620,6 +618,8 @@ var PadDiagram = GObject.registerClass({
                 this._prevEdited = this._curEdited;
             this._curEdited = null;
         }
+
+        this.queue_relayout();
     }
 
     startEdition(action, idx, dir) {
@@ -641,6 +641,7 @@ var PadDiagram = GObject.registerClass({
             return;
         this._editorActor.show();
         editedLabel.hide();
+        this.queue_relayout();
     }
 });